package com.ada.service.controller;

import com.ada.service.bean.ConsumerComponent;
import org.apache.dubbo.rpc.RpcContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpRequest;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
public class HelloController {

    @Autowired
    ConsumerComponent consumerComponent;

    @RequestMapping("/hello")
    public String hello(HttpServletRequest request){
        String  hello1 = consumerComponent.sayHello1("world");
        String  hello2 = consumerComponent.sayHello2("world");
        return "provider1:"+hello1+"\n provider2:"+hello2;
    }
}
